Skip to content

[pull] master from GaijinEntertainment:master#993

Merged
pull[bot] merged 5 commits into
forksnd:masterfrom
GaijinEntertainment:master
May 14, 2026
Merged

[pull] master from GaijinEntertainment:master#993
pull[bot] merged 5 commits into
forksnd:masterfrom
GaijinEntertainment:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 14, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

aleksisch and others added 5 commits May 14, 2026 17:39
It's useful to be able to not repeat yourself. If tuple names
exactly match variable names we want to assign we should allow
to write unnamed tuple. See tests for more details.
Support unnamed -> named promotion for return tuples as well.
`def float(...)`, `def int(...)`, `def double(...)`, `def do(...)` were
rejected with error[30163] "invalid function name" — surprising next to
`def string(...)` and `def float2(...)`, which compiled fine. The parser
accepts all of them (function_name → das_type_name); a post-parse lint
guard was the gate, rejecting any name in a hardcoded C++-keyword set.
The asymmetry was just that set: `float` / `int` / `double` are C++
keywords, but `float2` / `string` / `int2` aren't.

Drop the function-name guard and have the AOT emitter mangle keyword
names the same way it already mangles operator overloads.

- daslib/aot_cpp.das: aotSuffixNameEx now seeds prefix = is_cpp_keyword,
  so `def float` AOTs to `_Funcfloat_<hash>` (valid C++) instead of
  literal `float`.
- src/ast/ast_lint.cpp: remove isValidFunctionName + its callsite. The
  other 5 isCppKeyword guards (module/enum/enum-value/struct/field)
  stay — those embed 1:1 into C++ and need the guard.
- tests/language/failed_reserved_names.das: drop the `def do` case and
  30163 from the expect line.
- tests/aot/test_cpp_keyword_names.das: positive test exercising
  `def float`/`def int`/`def double`/`def do` via interpreter, AOT,
  and JIT.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…eyword-function-names

infer/aot: allow C++-keyword function names via AOT name-mangling
…amed-tuple-conv

compiler: allow unnamed -> named tuples conversions on name match
@pull pull Bot locked and limited conversation to collaborators May 14, 2026
@pull pull Bot added the ⤵️ pull label May 14, 2026
@pull pull Bot merged commit d43f0c6 into forksnd:master May 14, 2026
@pull pull Bot had a problem deploying to github-pages May 14, 2026 20:58 Error
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants